REM NOTE! It is important that the reports and the data source are deployed in the same folder on the Report Server.
REM 	  If this is not the case the reports won't find the shared data source.	

REM Report Server User
set RSUSER=ReportPublisher

REM Report Server User Password
set RSUSERPW=ReportPublisher

REM Report Parent Folder on Report Server
set REPORTFOLDER=TestReports

REM Report Server URL
set SSRS_URL=http://stockholmweb06.adstockholm.se/ReportServer

REM Data Source Name
set DATA_SRC_NAME=ParvisDataSource

REM DB Connection String
set DB_CONNECTION=Data Source=sqlclusthlm.adstockholm.se;Initial Catalog=ParvisTest;Connect Timeout=60

REM Data Source Extension (SQL, OLEDB, ODBC or custom)
set DB_EXTENSION=SQL

REM Database Report User 
set DB_USERNAME=ParvisReportUser

REM Database Report User Password
set DB_PASSWORD=paul77coffey

REM MIME Type of Resource to Deploy
set MIME=image/jpeg

REM Deploy Parent Folder
rs -i DeployFolder.rss -s %SSRS_URL% -v REPORTFOLDER="%REPORTFOLDER%" -u %RSUSER% -p %RSUSERPW%

REM Deploy Datasource (Datasource must be deployed in the same folder as the reports on the server)
rs -i DeployDatasource.rss -s %SSRS_URL% -v EXTENSION="%DB_EXTENSION%" -v CONN="%DB_CONNECTION%" -v NAME="%DATA_SRC_NAME%" -v FOLDER="/%REPORTFOLDER%" -v USERNAME="%DB_USERNAME%" -v PASSWORD="%DB_PASSWORD%" -u %RSUSER% -p %RSUSERPW%

REM Loop .jpg Files In Current Directory And Deploy Pictures
for /f %%a IN ('dir /b *.jpg') do call rs -i DeployResources.rss -s %SSRS_URL% -v FOLDER="/%REPORTFOLDER%" -v REPORT="%%a" -v MIME=%MIME% -u %RSUSER% -p %RSUSERPW%

REM Loop .rdl Files In Current Directory And Deploy Reports
for /f "tokens=1,2 delims=." %%a IN ('dir /b *.rdl') do call rs -i DeployReports.rss -s %SSRS_URL% -v FOLDER="/%REPORTFOLDER%" -v REPORT="%%a" -v REPORTEXT=".rdl" -u %RSUSER% -p %RSUSERPW%

